/**
 * 
 */
package com.google.code.cisx.gwt.client.layouts;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @version $Id: LayoutTemplate.java 260 2008-11-30 09:06:35Z rahul.thakur.xdev $
 * @since 1.0
 */
public abstract class LayoutTemplate extends Composite {

  /**
   * Sets the specified {@link Widget} at the location specified by a string based placeholder in the template.
   * 
   * @param placeholder
   * @param component
   * @return instance of LayoutTemplate to facilitate a fluent builder API
   */
  public abstract LayoutTemplate setComponent(String placeholderId, Widget component);

  /**
   * Returns the {@link Widget} instance at placeholder location inside the layout template specified by the string
   * 
   * @param placeholder
   * @return Widget instance at the specified placeholder in the template.
   */
  public abstract Widget getComponent(String placeholderId);

  /**
   * Called after the components in the layout template have been added. We effectively separate the process of laying
   * out components in the layout container from the actual rendering. This is allow some flexibility and not getting
   * tied to specifying all the components that go into the layout container upfront.
   */
  public abstract void render();

}
